import { type RouteRecordRaw } from 'vue-router'

/* 引入视图 */
import loginView from '@/views/home/LoginView.vue'
import indexView from '@/views/home/IndexView.vue'
import homeView from '@/views/home/HomeView.vue'
import demoEchartsView from '@/views/demo/DemoEchartsView.vue'
import demoListView from '@/views/demo/DemoListView.vue'

const constantRoutes:Array<RouteRecordRaw> = [
    {
        path: '/',
        name: loginView.name!,
        component: loginView,
        meta: {
            keepAlive: true,
            isLeaf: true,
        }
    },
    {
        path: '/index',
        name: indexView.name!,
        component: indexView,
        children: [
            {
                path: '/home',
                name: homeView.name!,
                component: homeView,
                meta: {
                    keepAlive: true,
                    isLeaf: false,
                }
            },
            {
                path: '/demoEcharts',
                name: demoEchartsView.name!,
                component: demoEchartsView,
                meta: {
                    keepAlive: true,
                    isLeaf: true,
                }
            },
            {
                path: '/demoList',
                name: demoListView.name!,
                component: demoListView,
                meta: {
                    keepAlive: true,
                    isLeaf: true,
                }
            }
        ]
    }
]

export default constantRoutes